package com.syj.collect.model;

import android.os.Build;
import android.os.Bundle;
import android.os.Handler;

import androidx.annotation.RequiresApi;

import com.syj.collect.app.MainActivity;
import com.syj.collect.app.R;
import com.syj.collect.base.BaseActivity;
import com.syj.collect.utils.SPUtil;



public  class WelcomeActivity extends BaseActivity {
    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                //3秒以后跳转到登陆页面，
                // TODO: 2020/3/23   还需要加入登陆页面
                if (SPUtil.getPrefString("token", "").equals("")){
                    readyGo(WelcomeActivity.this,LoginActivity.class);
                }else {
                    readyGo(WelcomeActivity.this, MainActivity.class);
                }
                finish();
            }
        },2000);
    }
}
